﻿using System.Collections.Generic;

namespace K9Nano.Reporting;

public interface IReportEngine
{
    /// <summary>
    /// 统计报表
    /// </summary>
    /// <param name="report">报表</param>
    /// <param name="reportParameters">报表参数</param>
    /// <returns></returns>
    Task<ReportResult> ExectueAsync(Report report, IReadOnlyDictionary<string, object> reportParameters, CancellationToken cancellation);

    /// <summary>
    /// 导出结果数据
    /// </summary>
    /// <param name="report">报表</param>
    /// <param name="reportParameters">报表参数</param>
    /// <returns>保存导出数据的文件路径</returns>
    Task<string> ExportAsync(Report report, IReadOnlyDictionary<string, object> reportParameters, CancellationToken cancellation);
}

/// <summary>
/// 报表分页统计结果
/// </summary>
/// <param name="Total"></param>
/// <param name="Items"></param>
public record ReportResult(int Total, object? Items);
